<?php


namespace App\Rpc\common\impl;

use App\Common\Res;
use App\Common\StringUtils;
use App\Constants\ConstCode;
use App\Constants\ErrorCode;
use App\Rpc\common\SettingInterface;
use Hyperf\DbConnection\Db;
use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Hyperf\Config\Annotation\Value;


class SettingImpl implements SettingInterface
{
    use StringUtils, Res;

    /**
     * @Value("commonset.aliyun.oss.accessKeyId")
     */
    protected $accessKeyId;

    /**
     * @Value("commonset.aliyun.oss.accessKeySecret")
     */
    protected $accessKeySecret;

    /**
     * @Value("commonset.aliyun.oss.endpoint")
     */
    protected $endpoint;

    /**
     * @Value("commonset.aliyun.oss.bucket")
     */
    protected $bucket;

    /**
     * @Value("commonset.aliyun.oss.location")
     */
    protected $location;

    /**
     * 设备登录
     * @param array $params
     * @return array
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getBucketZipSet(array $params): array
    {
        $data = [
            'accessKeyId' => $this->accessKeyId,
            'accessKeySecret' => $this->accessKeySecret,
            'endpoint' => $this->endpoint,
            'bucket' => $this->bucket,
            'location' => $this->location,
        ];
        return $this->Success('获取成功', $data);
    }
}